package main;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static main.Bilet.*;
import static main.Ulga.*;

public class Main {
	
	private static InputStreamReader converter = new InputStreamReader(System.in);
	private static BufferedReader in = new BufferedReader(converter);

	private static int readInt(){
		try {
			return Integer.parseInt(in.readLine());
		} catch (NumberFormatException e) {
//			e.printStackTrace();
			return -1;
		} catch (IOException e) {
//			e.printStackTrace();
			return -1;
		}
			
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {		
		int optionChosen = -1;
		Biletomat biletomat = Biletomat.getInstance();
	
		while (optionChosen != 0) {
			System.out.println("1. Kupno biletu");
			System.out.println("2. Informacja o ilosci pieniedzy");
			System.out.println("0. Wyjscie");
			
			optionChosen = readInt();			
			
			if (optionChosen == 2)
				System.out.println(biletomat.ileWBiletomacie());
			else if (optionChosen == 1){
				while (optionChosen != 0) {
					System.out.println("1. normalny - 15 min");
					System.out.println("2. normalny - 30 min");
					System.out.println("3. normalny - calodobowy");
					System.out.println("4. ulgowy - 15 min");
					System.out.println("5. ulgowy - 30 min");
					System.out.println("6. ulgowy - calodobowy");
					System.out.println("0. Wyjscie");
					
					optionChosen = readInt();
					int ileDoZaplaty = 0;
					
					switch(optionChosen){
						case 1: ileDoZaplaty = biletomat.ileDoZaplaty(PIETNASTKA, NORMALNY); break; 
						case 2: ileDoZaplaty = biletomat.ileDoZaplaty(TRZYDZIESTKA, NORMALNY); break; 
						case 3: ileDoZaplaty = biletomat.ileDoZaplaty(DOBA, NORMALNY); break; 
						case 4: ileDoZaplaty = biletomat.ileDoZaplaty(PIETNASTKA, ULGOWY); break; 
						case 5: ileDoZaplaty = biletomat.ileDoZaplaty(TRZYDZIESTKA, ULGOWY); break; 
						case 6: ileDoZaplaty = biletomat.ileDoZaplaty(DOBA, ULGOWY); break;
					}					
							
					System.out.println(ileDoZaplaty);
			
				}
			}
				
				
		}
		
		
		
	}

}
